<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>去重排序递归</title>
		<!--
			                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
			
			
			
			
			
			
		-->
	</head>
	<body>
		<script type="text/javascript">
			
		//数组去重	面临大量数据的时候，消耗时间比较长
		var arr=[1,1,2,2,3,3,4,4,5,5,6,6,7,8,8,9,9];
		function repurt(arr){
			var arr1=[];
			for(var i=0;i<arr.length;i++){
				if(arr1.indexOf(arr[i])==-1){
					arr1.push(arr[i]);
				}
			}
		    return arr1
		}
		var f=repurt(arr)	
		console.log(f)	
			
			
		// 排序
		var arr=[1,10,11,2,5,3,55,33,44,4];
		   
		   function paixu(a,b){
		   	return a-b;
		   }
		   var temp= arr.sort(paixu);		
		   console.log(temp);   		
					
			
			
			
			
			/*
			 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * 
			 * */
		</script>
	</body>
</html>
